package com.warm.quartz.config;

import org.noear.solon.annotation.Bean;
import org.noear.solon.annotation.Configuration;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.quartz.SchedulerFactory;
import org.quartz.impl.StdSchedulerFactory;

/**
 * 定时任务配置（单机部署建议删除此类和qrtz数据库表，默认走内存会最高效）
 *
 * @author hh
 */
@Configuration
public class ScheduleConfig {
    @Bean
    public Scheduler initQuartz() throws SchedulerException {
        SchedulerFactory factory = new StdSchedulerFactory();

        return factory.getScheduler();
    }
}
